<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>

<c:set var="ctx" value="${pageContext.request.contextPath}" />

<div class="container" id="discoverPage" style="min-height: 800px">
	<div id="type-nav" class="hidden-phone">
	</div>
	<div id="filter-nav" >
		
		<div id="profit-nav">
		  <div id="profit">
		  </div></div>
		<div class="sort-box hidden-phone">
			<select name="sort-select">
				<option data="latest" class="sort2" key="5" id="itemSecname">最新上线</option> 
				<%-- <option data="finishes" key="5">即将完成</option> 
				<shiro:hasAnyRoles name="charitarian,sa,admin">
				<option data="unrecommends" class="need_recommend" key="5">需要推荐</option></shiro:hasAnyRoles> --%>
				<option data="views" key="5">热门服务</option>
				<option data="tags" tags="gold" key="7" class="sort1" id="itemFirstname">金牌服务</option>
				<option data="tags" tags="small" key="7" class="sort3" id="itemFname">小众服务</option>
				<!-- <option data="3" class="need_support" key="6">最需资助</option>
				<option data="4" class="need_attention" key="6">最需关注</option>  -->
			</select>
		</div>
		
		<div class="clearfix"></div>
	</div>
	<ul class="thumbnails" id="project-kind-list">
		
		<dl class="sel-dl dashed-line" style="height: auto;">
			<dt style="float: left;" class="visi-area">执行区域:</dt>
			<dd>
				<span id="regions"></span><span id="regions_all"
				style="display: none"></span>
			</dd>
			<dd class="attribute-more">
				<a href="javascript:void(0)" class="project_kind" id="more-region">更多<i
					class="down"></i></a> <a href="javascript:void(0)" class="project_kind visi-up"
					id="less-region" style="display: none; margin-left:-60px;">收起<i
					class="up"></i></a>
				</dd>
			</dl>
			
	</ul>
	<div class="" id="projects">
		<div id="proCon" style="min-height: 500px;">
			<div class="laoding-round"></div>
		</div>
		<input id="nextPage" value="" type="hidden" /> <input id="hasNext"
		value="" type="hidden" />
	</div>
	<div class="letter_send_error">
		<span class="show_error"></span><span>没有更多数据</span>
	</div>
	<a href="#top" class="back_top"></a>
</div>

<div id="city255448" class="modal hide fade" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header"
style="text-align: center; color: #834313; line-height: 30px; margin: 0px;">
选择城市</div>
<div class="modal-body">
	<p>
		<div id="cities"></div>
	</p>
</div>
<div class="modal-footer">
	<button class="btn" data-dismiss="modal" aria-hidden="true"
	style="background-color: #ffcc00; background-image: none; color: #834313;">关闭</button>
</div>
</div>

<!-- 分类选择服务分类选项 -->
<script type="text/html" id="peojectFl-template">
<$for(var i = 0;i<projectCategories.length;i++){$>
	<a key="3" data="<$=projectCategories[i].id$>" class="project_kind" id="kind<$=projectCategories[i].id$>"><$=projectCategories[i].categoryName$></a> 
	<$}$>										
	</script>
	<!-- 服务收益类型模板 -->
<script type="text/html" id="profit-template">
<$for(var i= 0;i<data.length;i++){$>
	<a key="4" data="<$=data[i].id$>" class="profit_kind" id="profit-item<$=data[i].id$>"><$=data[i].categoryName$></a> 
	<$}$>										
	</script>
	<!-- 执行区域模板 -->
<script type="text/html" id="regions-template">
<a href="javascript:void(0)" id="region_all" class="load_all" key="1">所有</a>
<$for(var i = 1;i<=result.length;i++){$>
	<$if(i<9){$>
		<a href="javascript:void(0)" key="4" data="<$=result[i-1].id$>"><$=result[i-1].name$></a>
	<$}else{$>
		<$if(i%10==9){$>
			<a href="javascript:void(0)" key="4" data="<$=result[i-1].id$>"><$=result[i-1].name$></a>
			<br>
		<$}else{$>
			<a href="javascript:void(0)" key="4" data="<$=result[i-1].id$>"><$=result[i-1].name$></a>
		<$}$>
	<$}$>
<$}$>										
</script>
<script type="text/html" id="cities-template">
<table class="table">
<$for(var i=1;i<=result.length;i++){$>
	<$if(i%5==1){$>
		<tr>
	<$}$>
		<td>
			<a href="javascript:void(0)" key="4" data="<$=result[i-1].id$>"><$=result[i-1].name$></a>
		</td>		
	<$}$>
</table>
</script>
<!-- 渲染服务数据 -->
<script type="text/html" id="project-template">
<div class="projects-container">
<$for(var i = 0;i<result.length;i++){$>
<$if(i%4 == 0) {$>
	<li class="span3 proj-brief" style="margin:0 0 20px 0;">
<$} else {$>
	<li class="span3 proj-brief" style="margin-bottom:20px;">
<$}$>
	<div class="thumbnail hidden-phone">
	<a href="${ctx }/project/detail?id=<$=result[i].id$>&flag=true" title="">
		<div class="imgframe">
			<div class="img-box">
				<img data-src="holder.js/300x200" alt="300x200" src="<$=result[i].photoUrl$>" style="width:100%;height:100%">
			</div>
		</div>
	</a>
	<div class="caption">
		<ul class="project-one">
			<li class="project-title"><a href="${ctx }/project/detail?id=<$= result[i].id $>&flag=true" title=""><$= result[i].name $> </a></li>
			<li class="project-function"><a href="javascript:void(0)"><i class="address"></i><$= result[i].cityRegion.name$></a></li>
			<li class="project-stats">
				<div class="project-jindu">
					<div class="projectpledged" ></div>
				</div>
				<div class="projectstats">
					<dl class="widtha">
						<dd><span id="attentioncount"><b> <$= result[i].attentionCount$></b></span> </dd>
						<dd>关&nbsp;&nbsp;注</dd> 
					</dl>
					<dl class="widthb">
						<dd>￥<span id="fundcurrent"><b><$= result[i].fundCurrent$></b></span></dd>
						<dd>已售金额</dd> 
					</dl>
					<dl class="widthc">
						<dd><span id="productamount"><b><$= result[i].productAmount$></b></span></dd>
						<dd>已售数量</dd>
					</dl>
					</dl>
				</div>
			</li>
		</ul>
	</div>
	</div>
  <div class="thumbnail visible-phone" style="margin:0px 20px 20px 20px;">
        <a href="${ctx }/project/detail?id=<$=result[i].id$>&flag=true" title="">
             <img alt="" src="<$=result[i].photoUrl$>">
        </a>
        <p style="height:70px;">
         <span class="visi-thum-name"><$=result[i].name $></span>
        <span class="visi-address"><$= result[i].cityRegion.name$></span>
        </p>
        <table style="height:50px;background-color:#f8f8f8;width:100%;">
           <tr>
           <td style="padding-left:10px;"><b><$= result[i].attentionCount$>人</b></td>
           <td><b>￥<$= result[i].fundCurrent$></b></td>
           <td><b><$= result[i].productAmount$>件</b></td>
           </tr>
           <tr>
           <td class="visi-thum" style="padding-left:10px;">关注人数</td>
           <td class="visi-thum">已售金额</td>
           <td class="visi-thum">已售数量</span>
           </tr>
       </table>
   </div>
	</li>
<$}$>
</div>
<$ if(totalPages>1){ $>
	<div class="pagination visi-pagination">
		<$==pagination$>
	</div>
<$ } $>
</script>

<c:if test="${env == 'production' }">
<script type="text/javascript">
seajs.use("${ctx}/assets/js-dist/project/discover-page");
</script>
</c:if>
<c:if test="${env != 'production' }">
<script type="text/javascript">
seajs.use("${ctx}/assets/js/project/discover-page");
</script>
</c:if>

